<style lang="scss" scoped>
    @import '../../css/training.scss';
</style>

<template>
    <section>

        <section class="tab-nav clearfix">
            <el-breadcrumb separator=" > " class="fl">
                <el-breadcrumb-item >培训</el-breadcrumb-item>
                <el-breadcrumb-item :to="{path: '/training/training-manage'}">培训管理</el-breadcrumb-item>
                <el-breadcrumb-item v-if="$route.meta">{{$route.meta.title}}</el-breadcrumb-item>
            </el-breadcrumb>
        </section>

        <section class="exam-box mt">

            <section class="train-name pt30">{{TrainName}}</section>

            <section class="traniing-info-tab exam-info-tab p-relative">
                <span v-for="item,$index in tabList" :class="{'active': tabIndex ==$index}" @click="tabActive($index)">{{item}}</span>
                <div class="p-absolute exam-info-tabr">
                    <span class="mr20" @click="goto('/training/exam-preview')">预览</span>
                    <span class="ml from-bank" @click="showQuestionBankTopic = true" v-if="!examCreate">+  从题库选题</span>
                </div>
            </section>

            <section class="exam-main-content">

                <section v-if="!editFlag" class="exam-space">
                    <span class="exam-space-item space-iconf" @click="setNewTestPaper">
                        <img src="../../images/Training-ic-paper.png" alt="">
                        <span class="space-txt fs-14 mt">新建空白试卷</span>
                    </span>
                    <div class="exam-space-item" @click="testPaperChoose = true">
                        <img src="../../images/Training-ic-Test-paper.png" alt="">
                        <span class="space-txt fs-14 mt">试卷库中选择</span>
                    </div>
                </section>
                <section v-else>

                    <section v-if="step==0">
                        <el-form ref="form" v-if="!examCreate"  :model="form">
                        <el-form-item prop="title"  class="mt30">
                            <el-input v-model="form.title" placeholder="输入考卷名称" class="exam-list-box"></el-input>
                        </el-form-item>
                        <el-row class="mt30">
                            <el-col :span="24">
                                <el-form-item>
                                    <editor  :content="form.desc" v-model="content"></editor>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row class="pb20 pt20">
                            <span style="padding-right: 60px;display: inline-block;color: #5a5e66;">合格分数</span><el-input v-model="form.score" placeholder="输入合格分数，如：80" class="paper-input-box"></el-input>
                            <span class="ml20" style="padding-right: 60px;color: #5a5e66;">考试时长</span><el-input v-model="form.score" placeholder="输入合格分数，如：80" class="paper-input-box"></el-input>
                        </el-row>
                        <el-form-item label="知识体系" prop="">
                            <el-select v-model="value" placeholder="请选择">
                                <el-option v-for="item in koptions"  :key="item.value"  :label="item.label" :value="item.value"></el-option>
                            </el-select><span class="ml" style="display:inline-block;width: 38px;height:38px;text-align: center;line-height: 38px;border:1px solid #d8dce5;border-radius: 2px;"><img style="height:20px;width:20px;" src="../../images/plus_ic.png" alt=""></span>
                        </el-form-item>

                        <section class="pt30 pb30 topic-types">
                            <!--<span class="mr"><img src="../../images/Training-ic-increase.png" alt=""></span>-->
                            <span class="question-types-btn mr" @click="addEventRadio">
                                <img src="../../images/Training-ic-increase.png" alt="">
                                <span class="fs-14">单选题</span>
                            </span>
                            <span class="question-types-btn mr"  @click="addEventMulti">
                                <img src="../../images/Training-ic-increase.png" alt="">
                                <span class="fs-14">多选题</span>
                            </span>
                            <span class="question-types-btn" @click="addEventSubItem">
                                <img src="../../images/Training-ic-increase.png" alt="">
                                <span class="fs-14">问答题</span>
                            </span>

                            <!--试题添加以后的状态-->
                            <!--<section style="background: #f7f8fa;">-->
                                <!--<ul>-->
                                    <!--<li>-->
                                        <!--<section class="edit-status1 clearfix" >-->
                                            <!--<div style="width:50px;" class="question-leftccol fl">-->
                                                <!--<span>Q1</span>-->
                                                <!--<span><img class="public-icon mt20" src="../../images/compile_ic.png" alt=""></span>-->
                                                <!--<span><img class="public-icon mt20" src="../../images/Training-ic-down.png" alt=""></span>-->
                                                <!--<span><img class="public-icon mt20" src="../../images/delete_ic.png" alt=""></span>-->
                                            <!--</div>-->
                                            <!--<div class="p-relative mt" style="margin-left: 50px;">-->
                                                <!--<div class="question-content mt20">-->
                                                    <!--<p class="question-topic">-->
                                                        <!--<span>1</span>-->
                                                        <!--<span>【单选题】</span>-->
                                                        <!--<span>迟到几次不扣工资</span>-->
                                                    <!--</p>-->
                                                    <!--<ul class="question-options">-->
                                                        <!--<el-radio-group v-model="questionAnswer">-->
                                                            <!--<li class="mt20 fs-14">-->
                                                                <!--<el-radio label="1" disabled >A<span class="ml20"></span>1次</el-radio>-->
                                                            <!--</li>-->
                                                            <!--<li class="mt20 fs-14">-->
                                                                <!--<el-radio label="2" disabled >B<span class="ml20"></span> 1次</el-radio>-->
                                                            <!--</li>-->
                                                            <!--<li class="mt20 fs-14">-->
                                                                <!--<el-radio label="3" disabled >C<span class="ml20"></span>1次</el-radio>-->
                                                            <!--</li>-->
                                                            <!--<li class="mt20 fs-14">-->
                                                                <!--<el-radio label="4" disabled>D<span class="ml20"></span>1次</el-radio>-->
                                                            <!--</li>-->
                                                        <!--</el-radio-group>-->
                                                    <!--</ul>-->
                                                <!--</div>-->
                                                <!--<div class="p-absolute answers-score">（10分）</div>-->
                                            <!--</div>-->
                                        <!--</section>-->

                                        <!--&lt;!&ndash;多选题添加完成后的状态&ndash;&gt;-->
                                        <!--&lt;!&ndash;<section class="edit-status2">&ndash;&gt;-->
                                        <!--&lt;!&ndash;2222&ndash;&gt;-->
                                        <!--&lt;!&ndash;</section>&ndash;&gt;-->

                                        <!--&lt;!&ndash;问答题添加框添加完成后的状态&ndash;&gt;-->
                                        <!--&lt;!&ndash;<section class="edit-status2">&ndash;&gt;-->
                                        <!--&lt;!&ndash;2222&ndash;&gt;-->
                                        <!--&lt;!&ndash;</section>&ndash;&gt;-->

                                    <!--</li>-->
                                <!--</ul>-->
                            <!--</section>-->

                            <!--试题类型添加框-->
                            <section v-show="addRadio == true" style="background: lightsalmon;width: 100%;" class="mt20">
                                <!--单选题添加框-->
                                <section class="add-content pb20 clearfix">

                                    <div class="ac-left-tab fl">
                                        <span class="mt20">Q1</span>
                                        <span class="mt20"><img class="public-icon" src="../../images/compile_ic.png" alt=""></span>
                                        <span class="mt20"><img class="public-icon" src="../../images/Training-ic-down.png" alt=""></span>
                                        <span class="mt20"><img class="public-icon" src="../../images/delete_ic.png" alt=""></span>
                                    </div>
                                    <div class="ac-right-table">
                                        <div class="ac-table-title mt20">
                                            <input class="input-type-a fs-14" type="text" placeholder="迟到几次不扣钱"><span class="fs-14 ml20" style="line-height: 42px;">【单选题】</span>
                                            <span class="fs-14 fr">
                        <span style="line-height: 42px;">分值<input class="ml mr inputTypes-two" type="text" value="10"> 分</span>
                    </span>
                                        </div>
                                        <div class="ac-table-out">
                                            <ul class="ac-table-box">
                                                <li v-if="!item.deleteSingleList" v-for="item,$index in contentList" :key="$index">
                                                    <el-radio label="item.answersRadio" v-model="item.answersRadio">{{item.answersOne}}</el-radio>
                                                    <input class="ml input-type-b" type="text" placeholder="迟到几次不扣钱" v-model="item.text">
                                                    <el-radio class="ml20" label="设为答案" v-model="item.answersOne"></el-radio>
                                                    <div class="fr cut-position-box">
                                                        <span @click="switchUp($index,item)"><img class="public-icon" src="../../images/Training-ic-Facing-up.png" alt=""></span>
                                                        <span @click="switchDown(item)" class="ml mr public-icon"><img src="../../images/Training-ic-down.png" alt=""></span>
                                                        <span @click="switchDelete(item)"><img class="public-icon" src="../../images/delete_ic.png" alt=""></span>
                                                    </div>
                                                </li>


                                                <li>
                                                    <span class="ml add-options-space fs-14" type="text">+添加选项</span>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>

                                </section>
                            </section>
                            <section v-show="addMulti == true" style="background: #f7f8fa;width: 100%;" class="clearfix mt20">

                            </section>
                            <section v-show="addSubItem == true" style="background: #f7f8fa;width: 100%;" class="clearfix mt20">
                                <!--问答题添加框-->
                                <section class="add-content pb20 clearfix mt">
                                    <div class="ac-left-tab fl">
                                        <span class="mt20">Q1</span>
                                        <span class="mt20"><img class="public-icon" src="../../images/compile_ic.png" alt=""></span>
                                        <span class="mt20"><img class="public-icon" src="../../images/Training-ic-down.png" alt=""></span>
                                        <span class="mt20"><img class="public-icon" src="../../images/delete_ic.png" alt=""></span>
                                    </div>
                                    <div class="ac-right-table">
                                        <div class="ac-table-title mt20">
                                            <input class="input-type-a fs-14" type="text" placeholder="迟到几次不扣钱"><span class="fs-14 ml20" style="line-height: 42px;">【问答题】</span>
                                        </div>
                                        <div class="ac-table-out mt20">
                                            <div class="ac-table-in">
                                                <textarea type="text"  placeholder="请输入内容" v-model="answersThree"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                </section>
                            </section>


                            <!--添加试题--按钮-->
                            <section class="addTypesBtn mt20" @mouseover="actionBtn" @mouseleave="offBtn">
                                <section class="addTypesBtn-on" v-show="showTopicSingleBtn">
                                    <img src="../../images/Training-ic-increase.png" alt="">
                                    <span class="fs-14 add-topic ml20 p-relative">
                                        <img class="p-absolute single_ic" style="top: 13px;left: -10px;" src="../../images/single_ic.png" alt="">添加题目
                                    </span>
                                </section>

                                <section v-show="showTopicTypesBtn">
                                    <!--<span class="mr"><img src="../../images/Training-ic-increase.png" alt=""></span>-->
                                    <span class="question-types-btn mr" @click="addEventRadio">
                                        <img src="../../images/Training-ic-increase.png" alt="">
                                        <span class="fs-14">单选题</span>
                                    </span>
                                    <span class="question-types-btn mr" @click="addEventMulti">
                                        <img src="../../images/Training-ic-increase.png" alt="">
                                        <span class="fs-14">多选题</span>
                                    </span>
                                    <span class="question-types-btn" @click="addEventSubItem">
                                        <img src="../../images/Training-ic-increase.png" alt="">
                                        <span class="fs-14">问答题</span>
                                    </span>
                                </section>
                            </section>
                        </section>

                        <!--试卷详情-->
                        <section class="mt">
                            <p class="pt20 pb20">试卷详情</p>
                            <table class="exam-detail-table fs-14">
                                <thead>
                                    <tr class="">
                                        <th>题型</th>
                                        <th>单选题</th>
                                        <th>多选题</th>
                                        <th>问答题</th>
                                    </tr>
                                </thead>
                                <tbody>

                                    <tr>
                                        <th>题数</th>
                                        <td>1道</td>
                                        <td>5道</td>
                                        <td>7道</td>
                                    </tr>
                                    <tr>
                                        <th>分值</th>
                                        <td>1道</td>
                                        <td>5道</td>
                                        <td>7道</td>
                                    </tr>
                                    <tr>
                                        <th>合计</th>
                                        <td colspan="2" ></td>
                                        <td>卷面总计30分</td>
                                    </tr>
                                </tbody>
                            </table>
                        </section>
                        <el-form-item>
                            <section class="p-relative fl" style="padding-right:20px;">
                                <el-checkbox v-model="checked">将试卷保存到试卷库</el-checkbox>
                                <img class="question_ic p-absolute" src="../../images/question_ic.png" alt="">
                            </section>
                            <section class="fl">
                                <el-checkbox v-model="checked" class="ml20">将试卷保存到题库</el-checkbox>
                            </section>
                        </el-form-item>
                        <el-form-item style="text-align: center;">
                            <el-button class="btn-active btn-or" @click="toGenerateTest">生成试卷</el-button>
                        </el-form-item>
                    </el-form>
                        <section v-show="examCreate" class="exam-create-box mt">

                            <section class="train-name">多麦企业文化考试</section>

                            <p>合格分数：90</p>
                            <p class="mt">考试时长：3小时</p>
                            <section class="pt20 pb20 ec-destit">
                                <el-input class="mr20">对公司文化，制度，以及公司文化的了解情况进行考核</el-input>
                                <span class="ec-edit"><img class="public-icon" src="../../images/compile_ic.png" alt=""></span>
                            </section>

                            <section style="background: #f7f8fa;" class="topic-types pb20">
                                <!--试题-->
                                <ul>
                                    <li>
                                        <section class="edit-status1 clearfix" >
                                            <div style="width:50px;" class="question-leftccol fl">
                                                <span>Q1</span>
                                                <span><img class="public-icon mt20" src="../../images/compile_ic.png" alt=""></span>
                                                <span><img class="public-icon mt20" src="../../images/Training-ic-down.png" alt=""></span>
                                                <span><img class="public-icon mt20" src="../../images/delete_ic.png" alt=""></span>
                                            </div>
                                            <div class="p-relative mt" style="margin-left: 50px;">
                                                <div class="question-content mt20">
                                                    <p class="question-topic">
                                                        <span>1</span>
                                                        <span>【单选题】</span>
                                                        <span>迟到几次不扣工资</span>
                                                    </p>
                                                    <ul class="question-options">
                                                        <el-radio-group v-model="questionAnswer">
                                                            <li class="mt20 fs-14">
                                                                <el-radio label="1" disabled >A<span class="ml20"></span>1次</el-radio>
                                                            </li>
                                                            <li class="mt20 fs-14">
                                                                <el-radio label="2" disabled >B<span class="ml20"></span> 1次</el-radio>
                                                            </li>
                                                            <li class="mt20 fs-14">
                                                                <el-radio label="3" disabled >C<span class="ml20"></span>1次</el-radio>
                                                            </li>
                                                            <li class="mt20 fs-14">
                                                                <el-radio label="4" disabled>D<span class="ml20"></span>1次</el-radio>
                                                            </li>
                                                        </el-radio-group>
                                                    </ul>
                                                </div>
                                                <div class="p-absolute answers-score">（10分）</div>
                                            </div>
                                        </section>

                                        <!--多选题添加完成后的状态-->
                                        <!--<section class="edit-status2">-->
                                        <!--2222-->
                                        <!--</section>-->

                                        <!--问答题添加框添加完成后的状态-->
                                        <!--<section class="edit-status2">-->
                                        <!--2222-->
                                        <!--</section>-->

                                    </li>
                                </ul>
                            </section>

                            <!--添加按钮-->
                            <section class="addTypesBtn mt20" @mouseover="actionBtn" @mouseleave="offBtn">
                                <section class="addTypesBtn-on" v-show="showTopicSingleBtn">
                                    <img src="../../images/Training-ic-increase.png" alt="">
                                    <span class="fs-14 add-topic ml20 p-relative">
                                    <img class="p-absolute single_ic" style="top: 13px;left: -10px;" src="../../images/single_ic.png" alt="">添加题目
                                </span>
                                </section>

                                <section v-show="showTopicTypesBtn">
                                    <!--<span class="mr"><img src="../../images/Training-ic-increase.png" alt=""></span>-->
                                    <span class="question-types-btn mr" @click="addEventRadio">
                                    <img src="../../images/Training-ic-increase.png" alt="">
                                    <span class="fs-14">单选题</span>
                                </span>
                                    <span class="question-types-btn mr" @click="addEventMulti">
                                    <img src="../../images/Training-ic-increase.png" alt="">
                                    <span class="fs-14">多选题</span>
                                </span>
                                    <span class="question-types-btn" @click="addEventSubItem">
                                    <img src="../../images/Training-ic-increase.png" alt="">
                                    <span class="fs-14">问答题</span>
                                </span>
                                </section>
                            </section>

                            <!--试卷详情-->
                            <section class="mt">
                                <p class="pt20 pb20">试卷详情</p>
                                <table class="exam-detail-table fs-14">
                                    <thead>
                                    <tr class="">
                                        <th>题型</th>
                                        <th>单选题</th>
                                        <th>多选题</th>
                                        <th>问答题</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <tr>
                                        <th>题数</th>
                                        <td>1道</td>
                                        <td>5道</td>
                                        <td>7道</td>
                                    </tr>
                                    <tr>
                                        <th>分值</th>
                                        <td>1道</td>
                                        <td>5道</td>
                                        <td>7道</td>
                                    </tr>
                                    <tr>
                                        <th>合计</th>
                                        <td colspan="2" ></td>
                                        <td>卷面总计30分</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </section>

                        </section>
                    </section>

                    <section v-if="step==1">
                        <!--发放试卷内容-->
                        <section class="send-paper-box">

                            <section class="send-paper-require">
                                <div>
                                    <label>答题时段</label>
                                    <el-date-picker v-model="dateStart" type="date" placeholder="选择日期"> </el-date-picker>
                                    <span class="ml20 mr20">至</span>
                                    <el-date-picker v-model="dateEnd" type="date" placeholder="选择日期"> </el-date-picker>
                                </div>
                                <div class="mt40">
                                    <label>答题时长 </label>
                                    <el-input class="mr20" value="120" placeholder="请输入时长"></el-input>分钟
                                </div>
                            </section>

                            <section class="send-tab-box">
                                <section class="send-tab-infolist">
                                    <span v-for="item,$index in tabList2"  :class="{'active': tabNoticeIndex == $index}" @click="tabNoticeActive($index)">{{item}}</span>
                                </section>
                            </section>

                            <section v-show="tabNoticeIndex==0" class="send-tab-box">
                                <div class="notice-middle">
                                    <div class="last-notice">剩余可发短信：0条</div>
                                    <p>提示：为保障短信正常送达，请注意用词，勿发送营销类信息，0.05元/条</p>
                                    <div><el-button class="recharge-btn" type="primary" @click="dialogLittle.centerDialogVisible = true">支付宝充值</el-button></div>
                                </div>
                            </section>

                            <section class="send-tab-box">
                                <div class="notice-main">
                                    <el-form ref="form" label-width="160px">
                                        <el-form-item v-if="tabNoticeIndex==1" label="主题" class="pt30">
                                            <el-input class="input" placeholder="请输入主题名称"></el-input>
                                        </el-form-item>
                                        <el-form-item v-if="tabNoticeIndex==1" label="抄送">
                                            <el-input class="input" placeholder="请输入邮箱，多个邮箱由英文间隔号隔开（选填）"></el-input>
                                        </el-form-item>
                                        <el-form-item :label="tabNoticeIndex==0?'短信内容':'正文'">
                                            <el-input type="textarea" :autosize="{ minRows:6}"  placeholder="请输入正文内容"></el-input>
                                        </el-form-item>
                                        <el-form-item label="学员明细">
                                            <div class="name-box"></div>
                                            <p class="notice-tip"><span class="color-main">蓝色名字</span>无电话，需补全才能收到通知</p>
                                        </el-form-item>
                                        <el-form-item>
                                            <el-button class="btn-active btn-or">发放</el-button>
                                        </el-form-item>
                                    </el-form>
                                </div>
                            </section>

                            <el-dialog
                                    :title="dialogLittle.title"
                                    :visible.sync="dialogLittle.centerDialogVisible"
                                    width="460px"
                                    center>
                                <el-input class="input-dialog" :placeholder="dialogLittle.placeholder"></el-input>
                                <p class="word-dialog-tap">支付方式：支付宝</p>
                                <p class="word-dialog-tap">收费标准：0.05元/条</p>

                                <span slot="footer" class="dialog-footer">
                <el-button class="dialog-btn-left" @click="dialogLittle.centerDialogVisible = false">取 消</el-button>
                <el-button class="dialog-btn-right" type="primary" @click="dialogLittle.centerDialogVisible = false">增 加</el-button>
            </span>
                            </el-dialog>

                        </section>

                    </section>



                </section>

            </section>
        </section>


        <!--弹窗-从题库选题-->
        <el-dialog
                title="试卷选择"
                :visible.sync="showQuestionBankTopic"
                width="50%"
                center>
            <section class="signup-total">
                <el-input
                        placeholder="请输入内容"
                        prefix-icon="el-icon-search"
                        v-model="input1"
                        class="sign-input">
                </el-input>
            </section>
            <section class="table-box mt">
                <el-table :data="questionBankTopicList" height="300">
                    <el-table-column property="paperName" label="题目" style="text-align: center;"></el-table-column>
                    <el-table-column property="QuestionNum" label="类型"></el-table-column>
                    <el-table-column property="CreateTime" label="知识体系"></el-table-column>
                    <el-table-column property="score" label="题分"></el-table-column>
                    <el-table-column label="操作">
                        <template slot-scope="scope">
                            <el-button type="text" size="small">应用</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </section>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="showQuestionBankTopic = false">确定</el-button>
            </span>
        </el-dialog>

        <!--弹窗-从试卷库里选择试卷-->
        <el-dialog
                title="试卷选择"
                :visible.sync="testPaperChoose"
                width="50%"
                center>
            <section class="signup-total">
                <el-input
                        placeholder="请输入内容"
                        prefix-icon="el-icon-search"
                        v-model="input1"
                        class="sign-input">
                </el-input>
            </section>
            <section class="table-box mt">
                <el-table :data="testPaperList" height="300">
                    <el-table-column property="paperName" label="试卷名称" style="text-align: center;"></el-table-column>
                    <el-table-column property="QuestionNum" label="试卷题目数"></el-table-column>
                    <el-table-column property="CreateTime" label="创建时间"></el-table-column>
                    <el-table-column label="操作">
                        <template slot-scope="scope">
                            <el-button type="text" size="small">应用</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </section>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="testPaperChoose = false">知道了</el-button>
            </span>
        </el-dialog>

    </section>
</template>

<script>

	import qs from 'qs'
	import editor from '../../components/wangeditor.vue'
	export default{
		data: function(){
			return {
				TrainName:'《多麦企业文化培训》',
				tabList:['编辑试卷','发放试卷','考试结果'],
				tabList2:['短信通知','邮件通知'],
				tabIndex: 0,
				tabNoticeIndex: 0,
				step: 0,// 初始编辑状态
				testPaperChoose: false,
				testPaperList:[
					{"paperName": "新人培训考试","PassScore": "60","CreateTime": "2017-12-07 12:56:06","QuestionNum": "1"},
					{"paperName": "新人培训考试","PassScore": "60","CreateTime": "2017-12-07 12:56:06","QuestionNum": "1"},
					{"paperName": "新人培训考试","PassScore": "60","CreateTime": "2017-12-07 12:56:06","QuestionNum": "1"},
					{"paperName": "新人培训考试","PassScore": "60","CreateTime": "2017-12-07 12:56:06","QuestionNum": "1"},
					{"paperName": "新人培训考试","PassScore": "60","CreateTime": "2017-12-07 12:56:06","QuestionNum": "1"},
					{"paperName": "新人培训考试","PassScore": "60","CreateTime": "2017-12-07 12:56:06","QuestionNum": "1"},
					{"paperName": "新人培训考试","PassScore": "60","CreateTime": "2017-12-07 12:56:06","QuestionNum": "1"},
                ],
				questionBankTopicList:[
					{"paperName": "我是题目","PassScore": "选择题","CreateTime": "运营","QuestionNum": "1",score:'3'},
					{"paperName": "我是题目","PassScore": "选择题","CreateTime": "运营","QuestionNum": "1",score:'3'},
					{"paperName": "我是题目","PassScore": "选择题","CreateTime": "运营","QuestionNum": "1",score:'3'},
					{"paperName": "我是题目","PassScore": "选择题","CreateTime": "运营","QuestionNum": "1",score:'3'},
					{"paperName": "我是题目","PassScore": "选择题","CreateTime": "运营","QuestionNum": "1",score:'3'},
                ],  //题库试卷列表
                form:{
					title: '',
					desc: '可在此输入考试的要点，如： 考试对象、考核点、是否影响绩效、建议用时等提醒，可不填。',
					score: '',
                },
                form2:[
                    {}
                ],
				form3:[
					{}
				],
				editFlag: false,//是否编辑状态
                initHasTest: false,      // 有无试卷， 不能重写
				koptions: [
					{value: '选项1',label: '黄金糕'},
					{value: '选项1',label: '黄金糕'},
					{value: '选项1',label: '黄金糕'},
				],
				value:'',
				showQuestionBankTopic: false,  //从题库选择
				addRadio:false,  //添加单选题
                addMulti:false,  //添加多选题
                addSubItem:false,  //添加问答题
				questionAnswer: '',  //选择题答案选项
				setQuestionAnswer:'',
				showTopicTypesBtn: false,  //显示题目类型按钮
				showTopicSingleBtn: true,  //显示添加题目按钮
//                添加单选题
				answersOne:'',  //单选题答案
				answersThree:'',   //多选题答案
				contentList:[
					{answersRadio: '1',answersOne:'A',text:'我是单条答案',deleteSingleList:false},
					{answersRadio: '2',answersOne:'B',text:'我是单条答案',deleteSingleList:false},
					{answersRadio: '3',answersOne:'C',text:'我是单条答案',deleteSingleList:false},
				],
//                切换单条数据
				itemIndex:'',

//              点击生成试卷
//				questionAnswer: '3',
//				showTopicSingleBtn: true,
//				showTopicTypesBtn : false,
				examCreate:false,

//                发放试卷
				dialogLittle:{
					centerDialogVisible: false,
					title:'短信充值',
					placeholder:'请输入所需短信条数'
				},

//                预览
				examAnswerShow: true,
				examAnswerHide: false,

//                发放试卷
				dateStart:'',
                dateEnd:'',
            }
		},
		mixins: [mixinMethods],
		methods: {
			tabActive(i){//显示tab
                console.log('xxx: '+ i);

                if(!this.initHasTest){
                	this.$message.error('请先添加试卷');
                	return ;
                }

                console.log('set index: ' + i);

				let self = this;
				self.tabIndex = i;
				self.step = i;

				console.log('set: '+ this.step);

			},
			tabNoticeActive(e){
				let self = this;
				self.tabNoticeIndex = e;
            },
			setNewTestPaper(){//新建空白试卷
				let self = this;
				self.step = 0;

				//self.hasTest = true;
                self.editFlag = true;
            },
			addEventRadio(){
				let self = this;
				self.addRadio = !self.addRadio;//未编辑状态下切换按钮----可以收回弹框

            },
			addEventMulti(){
				let self = this;
				self.addMulti = !self.addMulti;
            },
			addEventSubItem(){
				let self = this;
				self.addSubItem = !self.addSubItem;//未编辑状态下切换按钮----可以收回弹框
            },
			actionBtn(){
				let self = this;
				self.showTopicTypesBtn = true;
				self.showTopicSingleBtn = false;
            },
			offBtn(){
				let self = this;
				self.showTopicTypesBtn = false;
				self.showTopicSingleBtn = true;
            },
			toGenerateTest(){
				let self = this;
				self.examCreate = true;  //点击生成试卷
            },
			isShowAnswerTxt(){//预览
				let self = this;
				self.examAnswerShow = !self.examAnswerShow;
				self.examAnswerHide = !self.examAnswerHide;
			}
		},
		mounted: function(){
            // 需要请求接口配置
			//this.editFlag = false;
            this.initHasTest = true;//初始化有试卷
//			this.editFlag = true;//编辑状态

//            setInterval(()=>{
//            	console.log(this.step+' : '+ this.editFlag);
//
//            }, 1000)
		},
		components: {
			editor: editor
		}
	}


</script>